﻿using FreeSql.DataAnnotations;
using KrasDD.Attributes;

namespace KrasDD.Models
{
    [
        JsonObject(MemberSerialization.OptIn),
        Table(Name = "[innovator].[DOCUMENT]", DisableSyncStructure = false)
    ]
    [ItemType("6F83A1B4C5D6E7F8A9B0C1D2E3F4A5BA", "DOCUMENT")]
    public partial class DOCUMENT : AppBaseEntity
    {
        [JsonProperty, Column(DbType = "char(32)")]
        public string ARAS_UNIQUENESS_HELPER { get; set; }

        [JsonProperty, Column(StringLength = 64)]
        public string AUTHORING_TOOL { get; set; }

        [JsonProperty, Column(StringLength = 32)]
        public string AUTHORING_TOOL_VERSION { get; set; }

        [JsonProperty, Column(StringLength = 128)]
        public string DESCRIPTION { get; set; }

        [JsonProperty, Column(StringLength = 64)]
        public string DRAWING_SIZE { get; set; }

        [JsonProperty]
        public DateTime? EFFECTIVE_DATE { get; set; }

        [JsonProperty, Column(StringLength = 256)]
        public string EXTERNAL_ID { get; set; }

        [JsonProperty, Column(StringLength = 128)]
        public string EXTERNAL_OWNER { get; set; }

        [JsonProperty, Column(StringLength = 128)]
        public string EXTERNAL_TYPE { get; set; }

        [JsonProperty, Column(DbType = "char(32)")]
        public string FROM_TEMPLATE { get; set; }

        [JsonProperty, Column(StringLength = 64)]
        public string NAME { get; set; }

        [JsonProperty, Column(StringLength = 16)]
        public string SCALE { get; set; }

        [JsonProperty, Column(StringLength = 64)]
        public string SPECIFICATION_TYPE { get; set; }

        [JsonProperty]
        public DateTime? RELEASE_DATE { get; set; }

        [JsonProperty]
        public DateTime? SUPERSEDED_DATE { get; set; }

        [JsonProperty, Column(StringLength = 128)]
        public string THUMBNAIL { get; set; }

        #region 外键 => 导航属性，OneToMany


        [Navigate("SOURCE_ID")]
        public virtual List<DOCUMENT_FILE> DOCUMENT_FILES { get; set; }

        #endregion
    }
}
